<?php //echo $this->form->render($this);?>

<script type="text/javascript">
function addImage(){
	var a = $('first_photo').clone();	
	var count = $('photo_container').getElements('input[type="file"]').length + 1;	
	a.set('id', '');
	var description = $("photo_description");
	var file = a.getElement('input[type="file"]');
	if(file){
		file.set('name', 'photo_' + count);
	}

	var clone_title = a.getElement('input[type="text"]');
	if(clone_title && description){
		clone_title.set('value', '');
		clone_title.set('class','photo_title');
	}

	var clone_description = a.getElement("textarea");
	if(clone_description && description){
		clone_description.set('value', '');
		clone_description.set('class','photo_desc');
	}
	a.inject($('photo_container'));
	
}

</script>
<form id="story_create_4" enctype="multipart/form-data" class="global_form" action="<?php echo $this->baseUrl(); ?>/stories/createex" onsubmit="return en4.story.handlesubmit(this);" method="post"><div><div><div class="form-elements">
<div id="title-wrapper" class="form-wrapper"><div id="title-label" class="form-label"><label for="title" class="required">Title</label></div>
<div id="title-element" class="form-element">
<input type="text" name="title" id="title" value=""></div></div>
<div id="location-wrapper" class="form-wrapper"><div id="location-label" class="form-label"><label for="location" class="optional">Location</label></div>
<div id="location-element" class="form-element">
<input type="text" name="location" id="location" value=""></div></div>
<div id="description-wrapper" class="form-wrapper"><div id="description-label" class="form-label"><label for="description" class="optional">Short Description</label></div>
<div id="description-element" class="form-element">
<textarea name="description" id="description" cols="45" rows="6"></textarea></div></div>
<div id="photo_container">
<div id="first_photo">
<div id="photo-wrapper" class="form-wrapper">
	<div id="photo-label" class="form-label">
		<label for="photo" class="optional">Image for Story</label>
	</div>
	<div id="photo-element" class="form-element">		
		<input type="file" name="photo_1" id="photo">
	</div>
</div>
<div id="photo_title-wrapper" class="form-wrapper">
	<div id="photo_title-label" class="form-label">
		<label for="photo_title" class="optional">Image Title</label>
	</div>
	<div id="photo_title-element" class="form-element">
		<input type="text" name="photo_title[]" id="photo_title" class="photo_title" value="">
	</div>
</div>
<div id="photo_description-wrapper" class="form-wrapper">
	<div id="photo_description-label" class="form-label">
		<label for="photo_description" class="optional">Image Description</label>
	</div>
	<div id="photo_description-element" class="form-element">
		<textarea class="photo_desc" name="photo_description[]" id="photo_description" cols="45" rows="6"></textarea>
	</div>
</div>
</div>
</div>

<a href="javascript:void(0);" onclick="addImage();">More Image</a>

<div id="agree-wrapper" class="form-wrapper"><div class="form-label" id="agree-label">&nbsp;</div>
<div id="agree-element" class="form-element">
<input type="hidden" name="agree" value=""><input type="checkbox" name="agree" id="agree" value="1" checked="checked">
<label for="agree" class="optional">I accept the term and privacy of story creation</label></div></div>
<div id="buttons-wrapper" class="form-wrapper"><div id="buttons-label" class="form-label">&nbsp;</div><div id="buttons-element" class="form-element"><div class="form-wrapper" id="buttons-wrapper"><fieldset id="fieldset-buttons">

<button name="submit" id="submit_4" type="submit">Save</button>

<button name="publish" id="publish" type="submit">Save &amp; Publish</button>

 or <a name="cancel" id="cancel" type="button" href="javascript:void(0);" onclick="history.go(-1); return false;">cancel</a></fieldset></div></div></div>

<input type="hidden" name="category_id" value="4" id="category_id">

<input type="hidden" name="tags" value="" id="tags">
<input type="hidden" name="number_photo" value="1" id="tags">

<input type="hidden" name="story_id" value="<?php echo $this->story_id; ?>" id="story_id">

<input type="hidden" name="auth_view" value="" id="auth_view">

<input type="hidden" name="auth_comment" value="" id="auth_comment">

<input type="hidden" name="story_category" value="" id="story_category"></div></div></div></form>

